package com.example.controller;

import com.example.pojo.*;
import com.example.service.QyService;
import com.example.service.impl.QyServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@CrossOrigin
@RequestMapping("/fy")
@RestController
public class QyController {
    @Autowired
    private QyService qyService;

    //图1，轮播
    @GetMapping("/t1")
    public Result t1(){
        List<Fy> list=qyService.t1();
        return Result.success(list);
    }

    //图2，地图，各区域均价
    @GetMapping("/t2")
    public Result t2(){
        List<Fd> fdjs = qyService.t2();
        return Result.success(fdjs);
    }

    //图3 各区房源数量
    @GetMapping("/t3")
    public Result t3(){
        List<Qy> qies = qyService.t3();
        return Result.success(qies);
    }


    //图4 出售数量前10的小区
    @GetMapping("/t4")
    public Result t4(){
        List<Fname> list=qyService.t4();
        return Result.success(list);
    }

    //图5 出售单价前10的小区
    @GetMapping("/t5")
    public Result t5(){
        List<Fdj> list=qyService.t5();
        return Result.success(list);
    }

    //贵阳总户型分布
    @GetMapping("/t6")
    public Result t6(){
        List<Hx> list=qyService.t6();
        return Result.success(list);
    }

    //各区户型分布
    @GetMapping("/t7")
    public Result t7(){
        List<Fqh> list = qyService.t7();
        return Result.success(list);
    }}
